package com.hundun.hddeal.dao;

import com.hundun.hddeal.entity.OrderDetail;
import com.hundun.hddeal.entity.OrderNew;
import com.hundun.hddeal.vo.StatusCountVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Date;
import java.util.List;
/**
 * 预约公众号接口
 * @author 谢
 */
@Component
public interface OrderDetailMapper {
    int deleteByPrimaryKey(Long id);

    int insert(OrderDetail record);

    int insertSelective(OrderDetail record);

    OrderNew selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderDetail record);

    /**批量更新链接专用*/
    int updateByPrimaryKey(OrderDetail record);

    List<OrderNew> selectByAdIdAndStatus(@Param("adId")String adId, @Param("status")int status, @Param("needName") String needName, @Param("startTime")Date startTime,
                                         @Param("endTime") Date endTime,@Param("hostId")String hostId,@Param("orderId") String orderId, @Param("gzhName") String gzhName);

    List <OrderDetail> selectByMtIdAndStatus(@Param("mtId") String mtId, @Param("status") int status, @Param("orderId") String orderId,
                                             @Param("needName") String needName, @Param("gzhName") String gzhName,
                                             @Param("startTime") Date startTime, @Param("endTime") Date endTime,@Param("hostId")String hostId);

    OrderDetail selectByOrderId(String orderId);

    List<OrderDetail> selectByStatus(int status);

    StatusCountVo selectAllStatus(@Param("mtId") String mtId, @Param("adId")String adId, @Param("hostId")String hostId);

    int updateOrederStatus(@Param("status")int status,@Param("orderId")String orderId);

    /**查询所有*/
    List<OrderDetail> selectAll();

    /**查询媒体主id集合*/
    List <OrderDetail> mtHostList(@Param("mtId") String mtId,@Param("hostId") String hostId,
                                @Param("needName") String needName,@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    /**查询广告主id集合*/
    List <OrderDetail> adHostList(@Param("adId") String adId,@Param("hostId") String hostId, @Param("needName") String needName,@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    /**通过hostId查询订单详情*/
    List<OrderDetail> getDetails(@Param("hostId") String hostId,@Param("adId") String adId,@Param("mtId") String mtId);

    /**查询批量ids订单*/
    List<OrderDetail> idsOrder(@Param("ids") Long[] ids);

    /**查询公众号在订单是否有档期*/
    OrderDetail getOrederGzh(@Param("ghId")String ghId,@Param("time")Date time,@Param("place") String place);

    /**更新已评价*/
    int updatePublish(@Param("hostId")String hostId,@Param("isPublish")Integer isPublish);

    /**查询评价的订单*/
    List<OrderDetail> getOrderHostId(@Param("hostId") String hostId);

}